{extends file="assets::smarty-templates::Master"|toPath}
{block name="subtitle"}:: Editar Contenido{/block}
{block name="content"}
<div class="portlet x8">
    <div class="portlet-header">
        <h4>Archivos del Plugins</h4>
        <a href="{$index}" class="btn-small btn-icon btn-grey btn-arrow-left right" ><span></span>Regresar al Listado</a>
    </div>
    <div class="portlet-content">
        <ul class="gallery">
            {foreach $medias as $media}
                <li>
                    <img alt="" src="../media/sliders/{$media['name']}.{$media['format']}" height="100px" width="100px"/>
                    <div class="actions">	
                        <a class="btn btn-orange btn-small" rel="facebox" href="../media/sliders/{$media['name']}.{$media['format']}">Ver</a>
                        <a data-url="{$delete}&idMedia={$media['id']}" class="btn btn-grey btn-small delete">Eliminar</a>
                    </div>
                </li>
            {/foreach}
        </ul>
    </div>
</div>
<div class="portlet x4">
    <div class="portlet-header">
        <h4>Subir un Archivo</h4>
    </div>
    <div class="portlet-content">
        <form id="add-user-form" action="{$action}" enctype="multipart/form-data" method="post" class="form label-top">
            <div class="field"><label for="file_name">Nombre del Archivo</label> <input id="file_name" name="file_name" size="30" type="text" value="" required /></div>
            <div class="field clearfix">								
                <label>Archivo</label>
                <input style="opacity: 0;" size="35" class="file" type="file" name="file" required accept="image/*" />								
            </div>
            <div class="field"><label for="file_title">Titulo</label> <input id="file_title" name="file_title" size="30" type="text" value="" required /></div>
            <div class="field"><label for="file_second_title">Segundo Titulo</label> <input id="file_second_title" name="file_second_title" size="30" type="text" value="" required /></div>
            <div class="buttonrow">
                <button class="btn" id="upload">Subir Archivo</button>
            </div>
        </form>
    </div>
</div>
<script>
    {literal}
        $(document).ready(function() {
            $(".delete").click(function(){
                var url = $(this).attr('data-url');
                $.get(url);
                location.reload();
            });
        });
    {/literal}
</script>
{/block}